<template>
  <div>
  <el-breadcrumb separator-class="el-icon-arrow-right" style="font-size: 16px;">
    <el-breadcrumb-item :to="{ path: '/' }">
      <i class="el-icon-s-promotion"></i> 后台管理
    </el-breadcrumb-item>
    <el-breadcrumb-item>评论列表</el-breadcrumb-item>
  </el-breadcrumb>
  <el-divider></el-divider>
  <el-table
      :data="tableData"
      style="width: 100%"
      :row-class-name="tableRowClassName">
    <el-table-column
        prop="id"
        label="ID"
        width="100"
        align="center">
    </el-table-column>
    <el-table-column
        prop="content"
        label="评论内容"
        width="180"
        align="center">
    </el-table-column>
    <el-table-column
        prop="workName"
        label="用户"
        width="300"
        align="center">
    </el-table-column>
    <el-table-column
        prop="passName"
        label="审核状态"
        width="180"
        align="center">
    </el-table-column>
    <el-table-column
        prop="created"
        label="创建时间"
        width="180"
        align="center">
    </el-table-column>
    <el-table-column
        prop="serveKinds"
        label="操作"
        width="180"
        align="center">
      <el-link>查看/</el-link>
      <el-link>修改/</el-link>
      <el-link>删除</el-link>
    </el-table-column>
  </el-table>
  </div>
</template>
<script>
export default {
  name: "ServiceAuditingView",
  methods: {
    tableRowClassName({row, rowIndex}) {

    },
    order(){
      let url = 'http://localhost:9081/comment';
      console.log('url = ' + url);

      this.axios
          .create({'headers': {'Authorization': localStorage.getItem('jwt')}})
          .get(url).then((response) => {
        let responseBody = response.data;
        console.log('state=' + responseBody.state);
        console.log('message=' + responseBody.message);
        this.tableData = responseBody.data;
        console.log(this.tableData)
      });
    }
  },
  data() {
    return {
      tableData: {
        id:'',
        serveKinds:'',
        worker:''
      }
    }
  },
  created() {
    this.order();
  },
}
</script>

<style scoped>
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
</style>